3.1.25 \(\int \sec ^m(e+f x) (m-(1+m) \sec ^2(e+f x)) \, dx\) [25]

Optimal. Leaf size=21 \[ -\frac {\sec ^{1+m}(e+f x) \sin (e+f x)}{f} \]

[Out]

-sec(f*x+e)^(1+m)*sin(f*x+e)/f

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {4128} \begin {gather*} -\frac {\sin (e+f x) \sec ^{m+1}(e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]^m*(m - (1 + m)*Sec[e + f*x]^2),x]

[Out]

-((Sec[e + f*x]^(1 + m)*Sin[e + f*x])/f)

Rule 4128

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e
+ f*x]*((b*Csc[e + f*x])^m/(f*m)), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[C*m + A*(m + 1), 0]

Rubi steps

\begin {align*} \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx &=-\frac {\sec ^{1+m}(e+f x) \sin (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.18, size = 21, normalized size = 1.00 \begin {gather*} -\frac {\sec ^{1+m}(e+f x) \sin (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]^m*(m - (1 + m)*Sec[e + f*x]^2),x]

[Out]

-((Sec[e + f*x]^(1 + m)*Sin[e + f*x])/f)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.85, size = 506, normalized size = 24.10

method result size
risch \(\frac {i \left (2^{m} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{-m} \left ({\mathrm e}^{i \left (\Re \left (f x \right )+\Re \left (e \right )\right )}\right )^{m} {\mathrm e}^{-m \Im \left (f x \right )-m \Im \left (e \right )} {\mathrm e}^{-\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3} \pi m}{2}} {\mathrm e}^{\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right ) \pi m}{2}} {\mathrm e}^{\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi m}{2}} {\mathrm e}^{-\frac {i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi m}{2}} {\mathrm e}^{2 i f x} {\mathrm e}^{2 i e}-2^{m} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{-m} \left ({\mathrm e}^{i \left (\Re \left (f x \right )+\Re \left (e \right )\right )}\right )^{m} {\mathrm e}^{-\frac {m \left (i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3} \pi -i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right ) \pi -i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi +i \mathrm {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi +2 \Im \left (e \right )+2 \Im \left (f x \right )\right )}{2}}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(506\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

I/f/(exp(2*I*(f*x+e))+1)*(2^m/((exp(2*I*(f*x+e))+1)^m)*exp(I*(Re(f*x)+Re(e)))^m*exp(-m*Im(f*x)-m*Im(e))*exp(-1
/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))
^2*csgn(I*exp(I*(f*x+e)))*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e
))+1))*Pi*m)*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*csgn(I/(exp(2*I*(f*
x+e))+1))*Pi*m)*exp(2*I*f*x)*exp(2*I*e)-2^m/((exp(2*I*(f*x+e))+1)^m)*exp(I*(Re(f*x)+Re(e)))^m*exp(-1/2*m*(I*cs
gn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi-I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*exp(I*(f
*x+e)))*Pi-I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*Pi+I*csgn(I*exp(I*(f*x
+e))/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*csgn(I/(exp(2*I*(f*x+e))+1))*Pi+2*Im(e)+2*Im(f*x))))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 305 vs. \(2 (23) = 46\).
time = 0.62, size = 305, normalized size = 14.52 \begin {gather*} \frac {2^{m} \cos \left (-{\left (f x + e\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) \sin \left (2 \, f x + 2 \, e\right ) - 2^{m} \cos \left (-{\left (f x + e\right )} m + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) \sin \left (2 \, f x + 2 \, e\right ) + {\left (2^{m} \cos \left (2 \, f x + 2 \, e\right ) + 2^{m}\right )} \sin \left (-{\left (f x + e\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - {\left (2^{m} \cos \left (2 \, f x + 2 \, e\right ) + 2^{m}\right )} \sin \left (-{\left (f x + e\right )} m + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )}{{\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, m} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

(2^m*cos(-(f*x + e)*(m + 2) + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(2*f*x + 2*e) - 2^m*cos(-(
f*x + e)*m + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(2*f*x + 2*e) + (2^m*cos(2*f*x + 2*e) + 2^m
)*sin(-(f*x + e)*(m + 2) + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - (2^m*cos(2*f*x + 2*e) + 2^m)*s
in(-(f*x + e)*m + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)))/((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^
2 + 2*cos(2*f*x + 2*e) + 1)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*m)*f)

________________________________________________________________________________________

Fricas [A]
time = 2.18, size = 32, normalized size = 1.52 \begin {gather*} -\frac {\frac {1}{\cos \left (f x + e\right )}^{m} \sin \left (f x + e\right )}{f \cos \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

-(1/cos(f*x + e))^m*sin(f*x + e)/(f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int \left (- m \sec ^{m}{\left (e + f x \right )}\right )\, dx - \int \sec ^{2}{\left (e + f x \right )} \sec ^{m}{\left (e + f x \right )}\, dx - \int m \sec ^{2}{\left (e + f x \right )} \sec ^{m}{\left (e + f x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)**m*(m-(1+m)*sec(f*x+e)**2),x)

[Out]

-Integral(-m*sec(e + f*x)**m, x) - Integral(sec(e + f*x)**2*sec(e + f*x)**m, x) - Integral(m*sec(e + f*x)**2*s
ec(e + f*x)**m, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x, algorithm="giac")

[Out]

integrate(-((m + 1)*sec(f*x + e)^2 - m)*sec(f*x + e)^m, x)

________________________________________________________________________________________

Mupad [B]
time = 2.75, size = 37, normalized size = 1.76 \begin {gather*} -\frac {\sin \left (2\,e+2\,f\,x\right )\,{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^m}{f\,\left (\cos \left (2\,e+2\,f\,x\right )+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((m - (m + 1)/cos(e + f*x)^2)*(1/cos(e + f*x))^m,x)

[Out]

-(sin(2*e + 2*f*x)*(1/cos(e + f*x))^m)/(f*(cos(2*e + 2*f*x) + 1))

________________________________________________________________________________________